<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="description" content="">
		<meta name="author" content="">
		<title>重置密码</title>
		<link rel="stylesheet" href="../../../css/base.css" />
		<link rel="stylesheet" href="../../../css/common.css" />
		<!-- Bootstrap Core CSS -->
		<link href="../../../sbadmin/bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
		<!-- MetisMenu CSS -->
		<link href="../../../sbadmin/bower_components/metisMenu/dist/metisMenu.min.css" rel="stylesheet">
		<!-- DataTables CSS -->
		<link href="../../../sbadmin/bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css" rel="stylesheet">
		<!-- Custom CSS -->
		<link href="../../../sbadmin/dist/css/sb-admin-2.css" rel="stylesheet">
		<!-- Custom Fonts -->
		<link href="../../../sbadmin/bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
		<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
		<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
		<!--[if lt IE 9]>
	<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
	<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
	<![endif]-->
		<style>
			body {
				padding: 0 15px 100px 15px !important;
			}
		</style>
	</head>

	<body style="background:#FFF;">
		<div class="comm-tt-font">重置密码</div>
		<div class="update-ccbox">
			<div class="update-tt">重置密码</div>
			<div class="update-cc">
				<div class="update-mbox">
					<div class="um-tbox">
						<input type="password" class="um-input" placeholder="新密码" id="czPwd" />
					</div>
					<div class="um-tbox mt20">
						<input type="password" class="um-input" placeholder="再次输入新密码" />
					</div>
					<input type="hidden" value="" id="loginId" />
					<input type="hidden" value="" id="userId" />
					<div class="clb mt20">
						<a href="#" class="fl qx-btn">取消</a>
						<a href="javascript:void(0);" class="fr qr-btn" id="updatePwd">确定</a>
					</div>
				</div>
			</div>
		</div>
		<!-- jQuery -->
		<script src="../../../sbadmin/bower_components/jquery/dist/jquery.min.js"></script>
		<!-- Bootstrap Core JavaScript -->
		<script src="../../../sbadmin/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
		<!-- Metis Menu Plugin JavaScript -->
		<script src="../../../sbadmin/bower_components/metisMenu/dist/metisMenu.min.js"></script>
		<!-- DataTables JavaScript -->
		<script src="../../../sbadmin/bower_components/datatables/media/js/jquery.dataTables.min.js"></script>
		<script src="../../../sbadmin/bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.min.js"></script>
		<!-- Custom Theme JavaScript -->
		<script src="../../../sbadmin/dist/js/sb-admin-2.js"></script>
		<script src="../../../js/layer/layer.js"></script>
		<script src="../../../js/common.js"></script>
		<!-- Page-Level Demo Scripts - Tables - Use for reference -->
		<script type="text/javascript">
			$(function() {
				var czId = localStorage.getItem("id");
				var loginId = localStorage.getItem("loginId");
				var userId = localStorage.getItem("userId");
				$("#loginId").val(loginId);
				$("#userId").val(userId);
				$("#updatePwd").click(function() {
					$.ajax({
						url: "https://order.wz1996.wang/wzbg/login/reset?pwd=" + $("#czPwd").val() + "&userId=" + $("#userId").val(),
						type: 'put',
						contentType: 'application/json',
						beforeSend: function(request) {
							request.setRequestHeader("token", localStorage.getItem("token"));
						},
						success: function(data) {
							console.log(data)
							if(data.code == "1") {
								layar("重置成功!");
								setTimeout("window.location.href='list.html'", 1000)
							} else if(data.code == "-1") {
								layar(data.msg);
								setTimeout("window.parent.frames.location.href='/xcxadmin/login.html'", 1000)
							} else {
								layar(data.msg);
							}
						},
						error: function(e) {
							errcode(e);
						}
					});

				})
			})
		</script>
	</body>

</html>